<?php
namespace app\validate;
use share\validate\SceneValidate;

class P2pUpgradeConfValidate extends SceneValidate{

    /**
     * 通用规则
     */
    protected $rule = [
        'id' => 'require|integer',
        'is_force' => 'require|integer',
        'name' => 'require|length:1,50',
        'start_span' => 'require|integer',
        'end_span' => 'require|integer',
        'check_first' => 'require|integer',
        'check_interval' => 'require|integer',
    ];    

    /**
     * 自定义场景的规则
     */
    protected $sceneRules = [
        'list' =>[     
            'is_force' => 'integer',
            'name' => 'length:1,50',
        ],
    ];

    protected $scene = [
        'list' => ['is_force','name'],
        'edit' => ['id','is_force','name','start_span','end_span','check_first','check_interval'],
        'del'  => ['id'],
    ];
}
